import { useDataShowHttp, useUserHttp } from '@/api/useHttp';
import {
  ICaidDisease,
  ICbidDisease,
  ICcadDisease,
  IChrdDisease,
  IDataCollectionParam,
  IDisCategoryReturn,
  IEpiDisease,
  INationNameReturn,
  R,
} from '@/api/types';

export enum DataShowCollectionApi {
  dataCollection = '/dataCollection/getData',
  nationName = '/getNation/getNationNames',
  diseaseCategory = '/diseaseCategory/getCategory',
  caidDisease = '/caidDisease/getCaid',
  cbidDisease = '/cbidDisease/getCbid',
  ccidDisease = '/ccidDisease/getCcid',
  epiDiease = '/epiDiease/getEpiDisease',
  chrdDisease = '/chrdDisease/getChrdAllName',
}

export const reqDataCollection = (param: IDataCollectionParam) => {
  return useDataShowHttp<R<null>>({
    url: DataShowCollectionApi.dataCollection,
    data: param,
    method: 'POST',
  });
};

export const reqNationName = () => {
  return useDataShowHttp<R<INationNameReturn>>({
    url: DataShowCollectionApi.nationName,
  });
};

export const reqDiseaseCategory = () => {
  return useDataShowHttp<R<IDisCategoryReturn>>({
    url: DataShowCollectionApi.diseaseCategory,
  });
};

export const reqCaidDisease = () => {
  return useDataShowHttp<R<ICaidDisease>>({
    url: DataShowCollectionApi.caidDisease,
  });
};
export const reqCbidDisease = () => {
  return useDataShowHttp<R<ICbidDisease>>({
    url: DataShowCollectionApi.cbidDisease,
  });
};
export const reqCcidDisease = () => {
  return useDataShowHttp<R<ICcadDisease>>({
    url: DataShowCollectionApi.ccidDisease,
  });
};
export const reqEpiDisease = () => {
  return useDataShowHttp<R<IEpiDisease>>({
    url: DataShowCollectionApi.epiDiease,
  });
};
export const reqChrdDisease = () => {
  return useDataShowHttp<R<IChrdDisease>>({
    url: DataShowCollectionApi.chrdDisease,
  });
};
